from fastapi import APIRouter, Request
from utils import create_json_response
import json

router = APIRouter()

@router.post("/message/view")
async def get_message_view(request: Request):
    """应用消息查看接口 - 根据应用ID和页数返回消息列表"""
    
    # 直接返回所有消息，不再处理参数
    messages = [
        {
            "id": 1,
            "name": "王小明",
            "url": "http://******/avatar_2.jpg",
            "content": "出差时间为2021年11月10日至11月15日，目的地为上海，出差事由为参加行业交流会。",
            "time": "14:22",
            "wfr": "true",
            "resolve": "审批通过",
            "reject": "驳回请求"
        },
        {
            "id": 2,
            "name": "王芳",
            "url": "http://******/avatar_1.jpg",
            "content": "采购部门提交的办公用品采购清单，总金额为5000元，包括打印纸、笔、文件夹等必备办公用品。",
            "time": "05:25",
            "wfr": "false",
            "resolve": "审批结果：同意。(By 张总)"
        },
        {
            "id": 3,
            "name": "大伟",
            "url": "http://******/avatar_3.jpg",
            "content": "为保障员工健康，公司将于本周末进行全员核酸检测，请各位同事按时参加。",
            "time": "12:32",
            "wfr": "false"
        },
        {
            "id": 4,
            "name": "赵敏",
            "url": "http://******/avatar_4.jpg",
            "content": "请假时间为2021年11月25日至11月30日，共计6天，请假事由为个人原因。",
            "time": "07:56",
            "wfr": "false",
            "reject": "审批结果：驳回。(By 李经理)"
        },
        {
            "id": 5,
            "name": "张三",
            "url": "http://******/avatar_5.jpg",
            "content": "项目进度汇报：前端开发已完成80%，预计下周可以进入测试阶段。",
            "time": "09:15",
            "wfr": "true",
            "resolve": "继续推进",
            "reject": "需要调整"
        },
        {
            "id": 6,
            "name": "李四",
            "url": "http://******/avatar_6.jpg",
            "content": "技术部门申请购买新的开发服务器，预算约2万元，用于提升开发效率。",
            "time": "16:30",
            "wfr": "true",
            "resolve": "同意采购",
            "reject": "预算不足"
        },
        {
            "id": 7,
            "name": "王五",
            "url": "http://******/avatar_7.jpg",
            "content": "人事部通知：本周五下午2点将举行新员工培训，请各部门安排人员参加。",
            "time": "10:45",
            "wfr": "false"
        },
        {
            "id": 8,
            "name": "赵六",
            "url": "http://******/avatar_8.jpg",
            "content": "市场部计划下周开展产品推广活动，需要各部门配合准备相关资料。",
            "time": "13:20",
            "wfr": "true",
            "resolve": "批准执行",
            "reject": "暂缓执行"
        }
    ]
    
    # 直接返回所有消息
    return create_json_response(messages)
